package org.mspring.mlog.web;

import javax.annotation.PostConstruct;

import org.mspring.mlog.service.JobService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * @since 2014-04-10 14:29:09
 * @author Gao Youbo
 */
@Component
public class ContextRefreshedHandler {

    private static final Logger log = LoggerFactory.getLogger(ContextRefreshedHandler.class);

    @Autowired
    private JobService jobService;

    @PostConstruct
    public void onApplicationEvent() {
        log.info("正在初始化容器...");
        // WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
        // WebContext.getInstance().setServletContext(wac.getServletContext());
        jobService.loadJobServer();
        log.info("容器初始化完成!");
    }

}
